package com.gaofeng.day06;

public class stringdemo05 {
    public static void main(String[] args) {
        //
        String strA = "abcde";
        String strB = "vdeab";

        boolean res = check(strA,strB);
        System.out.printf("🚀 ~ result:第一个字符串是%s,第二个字符串是%s",strA,strB);
        System.out.print(" 返回结果是" + res);

    }
    public static boolean check(String strA,String strB){
        for (int i = 0; i < strA.length(); i++) {
            strA = rotate(strA);
            if(strA.equals(strB)){
                return true;
            }
        }
        return  false;
    }
    public static String rotate(String str){

        char start = str.charAt(0);
        String end = str.substring(1);
        return  end + start;
    }
}
